home *** CD-ROM | disk | FTP | other *** search
/ Multimedia Selection / Multimedia Selection Volume One - CD-ROM / MULTIMEDIA SELECTION____________.ISO / programz / ldb / sdata.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-25  |  1.1 KB  |  64 lines

  1. /*
  2.  
  3.     sdata.hpp
  4.     10-25-91
  5.     Streamable Data: Loose Data Binder v 1.5
  6.  
  7.     Copyright 1991
  8.     John W. Small
  9.     All rights reserved
  10.  
  11.     PSW / Power SoftWare
  12.     P.O. Box 10072
  13.     McLean, Virginia 22102 8072 USA
  14.  
  15.     John Small
  16.     Voice: (703) 759-3838
  17.     CIS: 73757,2233
  18.  
  19. */
  20.  
  21. #ifndef SDATA_HPP
  22. #define SDATA_HPP
  23.  
  24. #ifndef SBINDER_HPP
  25. #include "sbinder.hpp"
  26. #endif
  27.  
  28.  
  29. class   SData;
  30. typedef SData * SDatA;
  31. #define SDatA0 ((SDatA)0)
  32.  
  33. #define ID_SData    2
  34. #define DID_Generic    0
  35. #define DID_String    1
  36.  
  37. class SData : Streamable {
  38. protected:
  39.     unsigned sizeofData, Did;
  40.     int dup;
  41.     voiD D;
  42.     void construct(voiD D, unsigned sizeofData,
  43.         unsigned Did, int dup);
  44.     virtual voiD clone(const voiD D);
  45. public:
  46.     STREAMABLE(SData,ID_SData,
  47.         Streamable);
  48.     SData(voiD D,
  49.         unsigned sizeofData,
  50.         unsigned Did  = DID_Generic,
  51.         int dup = 1)
  52.         : Streamable(UNIQUE_STREAMABLE,
  53.             ID_CLASS)
  54.         { construct(D,sizeofData,Did,dup); }
  55.     SData(char * s, int dup = 1);
  56.     operator voiD() { return D; }
  57.     unsigned SizeofData()
  58.         { return sizeofData; }
  59.     unsigned DID() { return Did; }
  60.     ~SData() { if (dup) delete D; }
  61. };
  62.  
  63. #endif
  64.